package com.hnqc.lw;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.StringTokenizer;

public class One {
    public static void main(String[] args) {
        String s="aaa,bbb,ccc";
        //方法一
        StringTokenizer stringTokenizer=new StringTokenizer(s,",");
        while (stringTokenizer.hasMoreElements()){
            System.out.println(stringTokenizer.nextToken());
        }
        //方法二
        String[] strings=s.split(",");
        System.out.println(strings[0]);
        System.out.println(strings[1]);
        System.out.println(strings[2]);

        List<String> alllist= Arrays.asList("yuwen","shuxue","yingyu","wuli");
        for (String s1:alllist){
            System.out.println(s1+"===========");
        }


    }
}
